home *** CD-ROM | disk | FTP | other *** search
/ Creative Review 30 / Creative-Review-CD-ROM-30.iso / mac / More / Simon Tyszko / atomic / 00002_Script_ball < prev    next >
Text File  |  1997-10-01  |  3KB  |  127 lines

  1. property psprite, phinc, pvinc, pspeed,pmyproximity,pmyvolume,phdist,pvdist
  2. property pheight
  3. property pwidth
  4. property ptrack
  5. property psizevalue
  6. property pcaststartnum
  7. property prandomfactor
  8. property pnumofcasts
  9. property prolloverflag
  10.  
  11.  
  12. on birth me, asprite, caststartnum, numofcasts
  13.   set pnumofcasts = numofcasts-1
  14.   set psprite = asprite
  15.   set pcaststartnum = caststartnum
  16.   set the puppet of sprite psprite = true
  17.   set pspeed = random(7)
  18.   set pheight = the height of sprite psprite
  19.   set pwidth = the width of sprite psprite
  20.   set the loch of sprite psprite = random(640)
  21.   set the locv of sprite psprite = random(480)
  22.   
  23.   set ptrack = psprite
  24.   
  25.   
  26.   return me
  27. end
  28. ---------------------------------------
  29. ---------------------------------------
  30. on move me, hinc, vinc
  31.   
  32.   set phinc = hinc
  33.   set pvinc = vinc
  34.   
  35.   ----moves the sprites
  36.   set the loch of sprite psprite ¼
  37.   = the loch of sprite psprite + (phinc/pspeed)
  38.   set the locv of sprite psprite ¼
  39.   = the locv of sprite psprite + (pvinc/pspeed)
  40.   
  41.   
  42.   
  43.   if the locv of sprite psprite > the stagebottom + (the height of sprite psprite) then¼
  44.     set the locv of sprite psprite = 0-----(the height of sprite psprite)
  45.   
  46.   if the locv of sprite psprite < 0-(the height of sprite psprite/2) then ¼
  47.     set the locv of sprite psprite = the stagebottom + (the height of sprite psprite)
  48.   
  49.   if the loch of sprite psprite > the stageright + (the width of sprite psprite) then set the loch¼
  50.   of sprite psprite = 0-(the width of sprite psprite)
  51.   
  52.   if the loch of sprite psprite < 0-(the width of sprite psprite) then set the loch¼
  53.   of sprite psprite = the stageright + (the width of sprite psprite)
  54.   
  55.   
  56. end move
  57. ---------------------------------------
  58. ---------------------------------------
  59. on makesound me
  60.   
  61.   set channelnumber = ptrack
  62.   if rollover(psprite) then
  63.     
  64.     if prolloverflag = false then
  65.       
  66.       puppetsound channelnumber, 161+psprite
  67.       set prolloverflag = true
  68.       set the volume of sound channelnumber = 128
  69.       
  70.     end if
  71.   else
  72.     set prolloverflag = false
  73.     if the volume of sound channelnumber >0 then fadesounddown
  74.     else
  75.       sound stop(channelnumber)
  76.     end if
  77.     
  78.   end if
  79.   
  80.   
  81. end makesound
  82.  
  83. ---------------------------------------
  84. ---------------------------------------
  85.  
  86. on animate me
  87.   
  88.   set the castnum of sprite psprite = the castnum of sprite psprite + 1
  89.   if the castnum of sprite psprite > pcaststartnum + pnumofcasts then
  90.     set the castnum of sprite psprite = pcaststartnum
  91.   end if
  92.   
  93. end animate
  94.  
  95. ---------------------------------------
  96. ---------------------------------------
  97.  
  98. on adjustsize me
  99.   
  100.   
  101.   set the height of sprite psprite¼
  102.     = (pheight * (pmyvolume/99.001))+2
  103.   set the width of sprite psprite¼
  104.     = (pwidth * (pmyvolume/99.001))+2
  105.   
  106.   
  107.   
  108. end 
  109.  
  110.  
  111. ---------------------------------------
  112. ---------------------------------------
  113.  
  114. on blend me
  115.   
  116.   set the blend of sprite psprite = (100.001/255)*pmyvolume
  117. end blend
  118.  
  119.  
  120. ---------------------------------------
  121.  
  122. on fadesounddown
  123.   set the volume of sound ptrack = the volume of sound ptrack -4
  124. end fadesounddown
  125.  
  126. ---------------------------------------
  127.